//
//  ZDQuestionFootView.m
//  ZHIDOU
//
//  Created by 向礼 on 2018/12/22.
//  Copyright © 2018 向礼. All rights reserved.
//

#import "ZDQuestionFootView.h"

@interface ZDQuestionFootView()

@property(nonatomic ,strong)UIButton *UpBtn;

@property(nonatomic ,strong)UIButton *NextBtn;

///查看解析
@property(nonatomic ,strong)UIButton *LookAnalysisABtn;

@end

@implementation ZDQuestionFootView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]) {
        [self subView];
    }
    return self;
}

#pragma mark - UI

-(void)subView{
    [self addSubview:self.UpBtn];
    [self addSubview:self.NextBtn];
    [self addSubview:self.LookAnalysisABtn];
}


#pragma mark - lazy
-(UIButton *)UpBtn{
    if (_UpBtn == nil) {
        _UpBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _UpBtn.backgroundColor = UIColorFromRGB(0xFFAE1F);
        _UpBtn.titleLabel.font = [UIFont systemFontOfSize:15];
        [_UpBtn setTitle:@"上一题" forState:UIControlStateNormal];
        [_NextBtn addTarget:self action:@selector(UpTip:) forControlEvents:UIControlEventTouchUpInside];
        _UpBtn.layer.cornerRadius = 20;
        _UpBtn.layer.masksToBounds = YES;
        _UpBtn.frame = CGRectMake(15, self.height - 60, 100, 40);
    }
    return _UpBtn;
}

-(UIButton *)NextBtn{
    if (_NextBtn == nil) {
        _NextBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _NextBtn.backgroundColor = UIColorFromRGB(0xFFAE1F);
        _NextBtn.titleLabel.font = [UIFont systemFontOfSize:15];
        [_NextBtn setTitle:@"下一题" forState:UIControlStateNormal];
        [_NextBtn addTarget:self action:@selector(Next:) forControlEvents:UIControlEventTouchUpInside];
        _NextBtn.layer.cornerRadius=20;
        _NextBtn.layer.masksToBounds = YES;
        _NextBtn.frame = CGRectMake(self.width - 115, self.height - 60, 100, 40);
    }
    return _NextBtn;
}

- (UIButton *)LookAnalysisABtn{
    if (_LookAnalysisABtn == nil) {
        _LookAnalysisABtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _LookAnalysisABtn.backgroundColor = UIColorFromRGB(0x666666);
        _LookAnalysisABtn.titleLabel.font = [UIFont systemFontOfSize:15];
        [_LookAnalysisABtn setTitle:@"查看\n解析" forState:UIControlStateNormal];
        [_NextBtn addTarget:self action:@selector(Look:) forControlEvents:UIControlEventTouchUpInside];
        _LookAnalysisABtn.titleLabel.lineBreakMode = 0;
        _LookAnalysisABtn.tintColor = UIColorFromRGB(0xFFFFFF);
        _LookAnalysisABtn.layer.cornerRadius=29;
        _LookAnalysisABtn.layer.masksToBounds = YES;
        _LookAnalysisABtn.frame = CGRectMake((self.width - 58)/2, self.height - 69, 58, 58);
        //_LookAnalysisABtn.center = self.center;
    }
    return _LookAnalysisABtn;
}

-(void)Next:(UIButton *)sender{
    if (_hander) {
        _hander();
    }
}

-(void)Look:(UIButton *)sender{
    
}

-(void)UpTip:(UIButton *)sender{
    
}

@end
